#define INCL_BASE
#define INCL_WIN
#define INCL_GPI
#define INCL_DEV

#include <OS2Ten.h>
#include <OS2.h>
#include <ClipApi.h>

HAB GetHab( void );

static DRIVDATA driv = { sizeof( DRIVDATA ) } ;

//----------------------------------------------------------------------------//

CLIPPER DEVOPENDC() // ( cDriver, cQueue, cDevice ) --> hDC
{
   DEVOPENSTRUC dop;

   _bset( ( LPBYTE ) &dop, 0, sizeof( DEVOPENSTRUC ) );

   dop.pszDriverName = _parc( 1 );
   dop.pszLogAddress = _parc( 2 );
   dop.pszDataType   = "PM_Q_STD";

   dop.pdriv         = NULL;

   _retnl( ( LONG ) ( HDC ) DevOpenDC( GetHab(), OD_QUEUED, "*", 4L,
           ( PDEVOPENDATA ) &dop, 0 ) );
}

//----------------------------------------------------------------------------//

CLIPPER DEVESCAPE() // ( hDC, nOperation, nFlags, cDocName, nFlag, nFlag ) -->
                    // nRetCode
{
   _retnl( ( LONG ) DevEscape( ( HDC ) _parnl( 1 ), _parnl( 2 ),
                               _parnl( 3 ), ( PBYTE ) _parc( 4 ),
                               ( PLONG ) _parnl( 5 ), ( PBYTE ) _parnl( 6 ) ) );
}

//----------------------------------------------------------------------------//

CLIPPER DEVCLOSEDC() // ( nHDC ) --> nRetCode
{
   _retnl( ( LONG ) DevCloseDC( ( HDC ) _parnl( 1 ) ) );
}

//----------------------------------------------------------------------------//
